﻿using System;
using System.Collections.Generic;

namespace Program24_1
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = new int[] { 2, 5, 8, 9, 12, 33 };
            //int[] arr1 = new int[] { 2, 4, 8, 10, 11, 33 };
            int[] arr1 = new int[] { 2, 5, 8, 2, 9, 11, 33 };

            List<int> arrList = new List<int>();
            arrList.AddRange(arr);
            arrList.AddRange(arr1);

            bool isRe = false;
            int x = 0;
            int[] arrT = new int[arr.Length + arr1.Length];

            for (int i = 0; i < arr.Length; i++)
            {
                arrT[i] = arr[i];
            }
            for (int i = 0; i < arr1.Length; i++)
            {
                isRe = true;
                for (int j = 0; j < arr1.Length; j++)
                {
                    if (arrT[j] == arr1[i])
                    {
                        isRe = false;
                        break;
                    }
                }
                if (isRe == true)
                {
                    arrT[(arr.Length) + x] = arr1[i];
                    x++;
                }
            }



            //Console.WriteLine("去除重复前");
            //foreach (var item in arrT)
            //{
            //    Console.Write(item+"|");
            //}

            Console.WriteLine("\n" + "去除重复筛入后");
            //for (int i = 0; i < arrList.Count; i++)
            //{
            //    //for (int j = 1; j < arrList.Count - 1; j++)
            //        for (int j = 0; j < arrList.Count; j++)
            //        {
            //            if (arrList[i] == arrList[j])
            //                if (arrList[i] == arrList[j] && i != j)
            //                {
            //                    arrList.RemoveAt(j);
            //                }
            //        }
            //}
            //foreach (var item in arrList)
                foreach (var item in arrT)
                {               
                    Console.Write(item + "|");
                }

        }
    }
}
